var should = require('should');
var assert = require('assert');
var _ = require('lodash');
var cdkModel = require('../../app/models/cdkModel');
var config = require('../config');
var mongoConnector = require('../../app/libs/mongodb/mongoConnector');
var Cdk = mongoConnector().model('Cdk');

suite('测试cdkModel', function () {
    var cdk_model;
    setup(function (done) {
        Cdk.remove({
            role_id: config.other_role_id
        }, function (err) {
            if (err) {
                return handleError(err);
            }

            cdkModel.getByRoleId(config.role_id, function (err, model) {
                assert.equal(null, err);
                cdk_model = model;
                cdk_model.toJSON();
                done();
            });
        });
    });

    suite('获取cdkModel', function () {
        test('getByRoleId', function (done) {
            cdkModel.getByRoleId(config.other_role_id, function (err, model) {
                done();
            });
        });
    });
});
